﻿/** \file
* \$Rev: 187 $
* 
* \$Date: 2010-04-27 21:58:51 +0000 (Tue, 27 Apr 2010) $
*
* \$URL: http://chorus-twitter.googlecode.com/svn/trunk/src/twitter/Message.cs $
*/

using System;
using System.Collections.Generic;
using chorus.utils;

namespace chorus.twitter
{
	/// <summary>
	/// A generic Twitter message. Statuses and direct messages are both
	/// derived from this class.
	/// </summary>
	public abstract class Message : TwitterID
	{
		/// <summary>The time at which the message was created.</summary>
        public SerDate created_at { get; set; }

		/// <summary>The message's text content.</summary>
		public string text { get; set; }

		/// <summary>The sending user of the message.</summary>
		public abstract user From { get; }
		/// <summary>The receiving user of the message.</summary>
		public abstract user To { get; }

		/// <summary>The status line describing message details.</summary>
		public virtual string StatLine
		{
			get
			{
				return
					created_at.val.ToString() +
					" (" + created_at.BriefString + ")" + Environment.NewLine +
					"By @" + From.screen_name;
			}
		}
	}

	/// <summary>
	/// An interface to get a collection of messages associated with a response.
	/// </summary>
	public interface IMessageCollectionResponse
	{
		/// <summary>The response message collection.</summary>
		IEnumerable<Message> Messages { get; }
	}
}
